//
//  CarAndBeautyDetailViewController.m
//  TheRoadAD
//
//  Created by 宁宁 on 16/8/17.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "CarAndBeautyDetailViewController.h"

#import "PhotoScrollView.h"//查看图片scrollView
#import "LookOverModelViewController.h"//查看车型/模特/摄影师信息Controller

@interface CarAndBeautyDetailViewController ()

@property (weak, nonatomic) IBOutlet PhotoScrollView *scrollView;

@end

@implementation CarAndBeautyDetailViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.hidden = NO;
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    _bar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor], NSFontAttributeName : [UIFont fontWithName:AppFont size:19]};
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    _currentNum.text = [NSString stringWithFormat:@"%d/%ld", _index + 1, _picArray.count];
    
    [self setPhotoScroll];
}

- (void)setPhotoScroll{
    
//    NSArray *arr = @[@"", @"", @"", @"", @"", @"", @""];
    [_scrollView setLayout:_picArray andIndex:_index];
    _pic.image = [UIImage imageNamed:_picArray[_index]];
    _scrollView.showPicClick = ^(int index){
        _currentNum.text = [NSString stringWithFormat:@"%d/%ld", index + 1, _picArray.count];
        
        _pic.image = [UIImage imageNamed:_picArray[index]];
        
    };
}

//车型
- (IBAction)car:(id)sender {
    LookOverModelViewController *look = [[LookOverModelViewController alloc] init];
    look.temp = 0;
    look.dataArray = @[@[@"headImg", @"商家名"]];
    look.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:look animated:YES];
}
//模特
- (IBAction)model:(id)sender {
    LookOverModelViewController *look = [[LookOverModelViewController alloc] init];
    look.temp = 1;
    look.dataArray = @[@[@"headImg", @"模特1"], @[@"headImg", @"模特2"], @[@"headImg", @"模特3"]];
    look.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:look animated:YES];
}
//摄像师
- (IBAction)photographer:(id)sender {
    LookOverModelViewController *look = [[LookOverModelViewController alloc] init];
    look.temp = 2;
    look.dataArray = @[@[@"headImg", @"摄影师1"], @[@"headImg", @"摄影师2"]];
    look.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:look animated:YES];
}

- (IBAction)back:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
